Update documentation for TypeScript 6.0 compiler option changes#3563
Update documentation for TypeScript 6.0 compiler option changes#35635cover wants to merge 15 commits into
Conversation
|
@microsoft-github-policy-service agree |
There was a problem hiding this comment.
Replace these 6 lines with:
Notice that our person and date parameters no longer have type annotations.
|
|
||
| > **Remember**: Type annotations never change the runtime behavior of your program. | ||
|
|
||
| ## Downleveling |
There was a problem hiding this comment.
Since this downleveling no longer happens by default, maybe this section should be removed. If not then it should at least explain that this only happens if you specify a target of ES5 and doing so results in error TS5107
rdsalcedo
left a comment
There was a problem hiding this comment.
I just started reading the handbook and noticed some of the out of date stuff in Basics.md . I found this pull request that addresses part of what I noticed, so that is the only file that I commented on.
|
I implemented your suggestions. I rewrote the downleveling section to explain downleveling in general, with the template string behavior as an example for pre-ES5 targets. |
This PR updates TypeScript Website documentation to match the TypeScript 6.0 compiler option defaults, removals, and deprecations described in the 6.0 release notes.
The main goal is to remove stale guidance that describes TypeScript 5.x behavior as the current default. In particular, the docs now make clear that projects should explicitly opt into global
@typespackages, modern module resolution and emit settings, and supported ECMAScript targets.Rationale
TypeScript 6.0 changes several long-standing defaults and deprecates older compiler behaviors. Some existing docs still described the previous behavior as current, which could lead users to:
node_modules/@typespackages to be loaded automatically;rootDir,module,target, and interop defaults from older TypeScript versions;tsconfig.jsonto be ignored;target: ES5,outFile, legacy namespacemodulesyntax, orno-default-libdirectives.This PR aligns the current reference, handbook, project config, and tutorial content with TypeScript 6.0 while preserving historical release notes.
Changes
typesandtypeRootsdocumentation for the newtypes: []default, including thetypes: ["*"]escape hatch for the old visible-@typesenumeration behavior.rootDirand relatedoutDirdocs for the TypeScript 6.0 default of the directory containing thetsconfig.json.strict,module,target,noUncheckedSideEffectImports, andlibReplacement.DOMnow includes the declarations previously split acrossDOM.IterableandDOM.AsyncIterable.downlevelIterationas deprecated because it only affects ES5 emit.node/node10,classic, andbaseUrl, including migration guidance towardpaths,nodenext, andbundler.none, andoutFileworkflows, steering users toward external bundlers.esModuleInterop,allowSyntheticDefaultImports, andalwaysStrict.module X {}namespace syntax as deprecated while keepingnamespace X {}documented./// <reference no-default-lib="true"/>as deprecated and recommendnoLibinstead.tsconfig.jsonwould otherwise be loaded unless--ignoreConfigis used.Validation